    //
//  SplashPageViewController.m
//  Cachalot
//
//  Created by Adam Cue on 4/1/11.
//  Copyright Adam Cue 2011.
//
//  This program is licensed and distributed under the terms of the GNU General Public License.  
//	The text for the license can be found in the license.txt file in this project.
//

#import "SplashPageViewController.h"

@interface SplashPageViewController (Private)
#pragma mark HelperMethods
- (void)splash;
@end

@implementation SplashPageViewController

- (void)viewDidLoad {
   [super viewDidLoad];
	[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(splash) userInfo:nil repeats:NO];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
   return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

#pragma mark HelperMethods
- (void)splash{
	int random = (arc4random() % 7) + 1;
	UIImage *splashImage;
	if([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight){
		splashImage = [UIImage imageNamed:[NSString stringWithFormat:@"splash%d_left", random]];
	}
	else{
		splashImage = [UIImage imageNamed:[NSString stringWithFormat:@"splash%d", random]];
	}
	splashView.image = splashImage;
}

@end
